package threadDemo1.double_start;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-02-27
 * Time: 02:02
 */
public class ThreadDemo {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            System.out.println("Hello Thread");
            //睡眠1秒
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });

        thread.start();
        //睡眠2秒
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        //抛出IllegalThreadStateException异常
        thread.start();
    }
}
